Method and device for adding menu item to android menu

ABSTRACT

A method and device for adding a menu item to an Android menu are provided. The method includes: receiving a request for opening a local menu, where the request carries a menu ID, and creating a local menu corresponding to the menu ID; obtaining according to the menu ID, in a stored correspondence between a menu item of a third-party application and the menu ID, a menu item of a corresponding third-party application; and adding the menu item of the third-party application to the local menu, and displaying the local menu to which the menu item of the third-party application is added. The device includes a first creating module, an obtaining module, and an adding module. The present invention is capable of adding a menu item of a third-party application to a local menu of a mobile phone without modifying an Android platform code.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2011/073864, filed on May 10, 2011, which claims priority toChinese Patent Application No. 201010176312.X, filed on May 14, 2010,both of which are hereby incorporated by reference in their entireties.

FIELD OF THE INVENTION

The present invention relates to the computer field, and in particular,to a method and device for adding a menu item to an Android menu.

BACKGROUND OF THE INVENTION

Android is a software platform and operating system based on the Linuxkernel. Android provides multiple functions and multiple local menus,where each local menu includes one or multiple menu items, and each menuitem corresponds to a function, so that each function may be startedfrom the local menus. Android may be used as a mobile operating system.A mobile phone manufacturer adds various third-party applications to theAndroid platform to develop mobile phones with different functions. Eachthird-party application includes one or multiple functions, and eachfunction corresponds to one menu item. The menu item corresponding toeach function of a third-party application is added to a local menu, sothat the functions included in the third-party application may bestarted from the local menu.

The Android platform has a database for storing menu items. A mobilephone manufacturer adds a menu item included in a third-partyapplication to the database by modifying a code in the Android platform.When a local menu is created, menu items are obtained from the databaseto make a local menu, thereby adding the menu item included in thethird-party application to the local menu. Then, the mobile phonemanufacturer burns the Android platform and the third-party applicationinto the memory of the mobile phones.

The inventors find that the prior art has at least the followingproblems:

When a mobile phone manufacturer adds a menu item of a third-partyapplication to a local menu, the mobile phone manufacturer needs tomodify an Android code. In addition, after a mobile phone is deliveredfrom a factory, data burned into the mobile phone memory cannot bemodified again. Therefore, when downloading a third-party application tothe mobile phone, the user cannot add a menu item in the third-partyapplication to the local menu of the mobile phone.

SUMMARY OF THE INVENTION

To add a menu item of a third-party application to a local menu of amobile phone without modifying an Android platform code, embodiments ofthe present invention provide a method and device for adding a menu itemto an Android menu. The technical solutions are as follows:

A method for adding a menu item to an Android menu includes:

receiving a request for opening a local menu, where the request carriesa menu ID, and creating a local menu corresponding to the menu ID;

obtaining according to the menu ID, in a stored correspondence between amenu item of a third-party application and a local menu ID, a menu itemof a corresponding third-party application;

adding the menu item of the third-party application to the local menu;and

displaying the local menu to which the menu item of the third-partyapplication is added.

A device for adding a menu item to an Android menu includes:

a first creating module, configured to receive a request for opening alocal menu, where the request carries a menu ID, and create a local menucorresponding to the menu ID;

an obtaining module, configured to obtain according to the menu ID, in astored correspondence between the menu item of a third-party applicationand a local menu ID, a menu item of a corresponding third-partyapplication; and

an adding module, configured to, add the menu item of the third-partyapplication to the local menu, and display the local menu to which themenu item of the third-party application is added.

When a local menu is opened, a menu item to be added to the local menuis obtained from a stored correspondence between a menu item of athird-party application and a local menu ID, and the obtained menu itemis directly added to the local menu. The menu item of the third-partyapplication is directly added to the local menu, therefore, withoutmodifying an Android code, the menu item of the third-party applicationmay be added to the database of an Android platform and the menu item ofthe third-party application may be added to the local menu.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings described here describe the present inventionmore clearly, constitute a part of the present application, and are notintended to limit the present invention. In the accompanying drawings:

FIG. 1 is a flowchart of a method for adding a menu item to an Androidmenu according to Embodiment 1 of the present invention;

FIG. 2 is a flowchart of a method for adding a menu item to an Androidmenu according to Embodiment 2 of the present invention;

FIG. 3 is a schematic diagram of a first kind of a local primary menuaccording Embodiment 2 of the present invention;

FIG. 4 is a schematic diagram of a second kind of a local primary menuaccording Embodiment 2 of the present invention;

FIG. 5 is a schematic diagram of a first kind of a local secondary menuaccording Embodiment 2 of the present invention;

FIG. 6 is a schematic diagram of a second kind of a local secondary menuaccording Embodiment 2 of the present invention; and

FIG. 7 is a schematic diagram of a device for adding a menu item to anAndroid menu according to Embodiment 3 of the present invention.

DETAILED DESCRIPTION OF THE EMBODIMENTS

To make the objective, technical solutions, and advantages of thepresent invention clearer, the following describes the present inventionin detail with reference to embodiments and accompanying drawings. Theillustrative embodiments of the present invention and descriptionthereof are used to describe the present invention, and are not intendedto limit the present invention.

Embodiment 1

As shown in FIG. 1, an embodiment of the present invention provides amethod for adding a menu item to an Android menu, including:

Step 101: Receive a request for opening a local menu, where the requestcarries a menu ID, and create a local menu corresponding to the carriedmenu ID.

Step 102: Obtain according to the carried menu ID, in a storedcorrespondence between a menu item of a third-party application and thelocal menu ID, a menu item of a corresponding third-party application.

Step 103: Add the obtained menu item of the third-party application tothe local menu, and display the local menu to which the menu item of thethird-party application is added.

In the embodiment of the present invention, a menu item of a third-partyapplication and an ID of a local menu to which the menu item belongs arestored; when the local menu is opened, the menu item to be added to thelocal menu is obtained according to a stored correspondence between themenu item of the third-party application and the local menu ID, and theobtained menu item is directly added to the local menu. The menu item ofthe third-party application is directly added to the local menu,therefore, without modifying an Android code, the menu item of thethird-party application may be added to the database of an Androidplatform and the menu item of the third-party application may be addedto the local menu.

Embodiment 2

As shown in FIG. 2, an embodiment of the present invention provides amethod for adding a menu item to an Android menu, including:

Step 201: When a user installs a third-party application in a mobilephone, search a file set of the third-party application for aconfiguration file.

The user may download the file set of the third-party application froman application developer, and store the file set of the third-partyapplication in the memory of the mobile phone. The third-partyapplication may include one or multiple functions, where each functionis implemented by a corresponding API (Application ProgrammingInterface) function. Therefore, the file set of the third-partyapplication stores the API function of each function for implementingthe third-party application.

The file set of the third-party application has a configuration file,where the configuration file exists as an XML (Extensible MarkupLanguage) file. The configuration file includes at least the followinginformation: a menu item and an ID of a local menu to which the menuitem belongs, where the menu item includes at least a menu item name andidentity information, and the identity information includes at least amenu ID of a secondary menu or a function ID. In addition, the identityinformation may further include an application ID. If the identityinformation includes a menu ID of a secondary menu, the identityinformation may uniquely identify a secondary menu; and if the identityinformation includes a function ID, the identity information mayuniquely identify a function. In addition, the menu item may furtherinclude an icon ID, and the like, and correspondingly, the file set ofthe third-party application further has an icon. In addition, the menuitem name exists in the form of a character string. The configurationfile may include multiple menu items and IDs of local menus to whicheach menu item belongs. A third-party application developer knows eachlocal menu in an Android platform in advance. If the third-partyapplication developer wants to add a menu item of a third-partyapplication to a local menu, the third-party application developer maydirectly define, in the configuration file of the third-partyapplication, the local menu ID, to which the menu item of thethird-party application belongs, to be the local menu ID.

For example, a third-party application is a mail system. A file set ofthe mail system has a configuration file, where the configuration fileincludes information shown in Table 1. As shown in Table 1, theconfiguration file of the mail system includes two menu items and IDs oflocal menus to which each menu item belongs. A first menu item includesa menu item name which is “Mail” and identity information which includesa function ID “ID101”, an application ID “ID10”, and an icon ID “ID102”.A second menu item includes a menu item named “DirectMessage” andidentity information including a function ID “ID103” and an applicationID “ID10”. A menu item may not include an icon ID. Therefore, an icon IDrecorded in a last line of Table 1 is left blank.

TABLE 1 Menu Item Local Menu Item Name Function ID Application ID IconID Menu ID Mail ID101 ID10 ID102 ID1 DirectMessage ID103 ID10 N/A ID18

Step 202: Obtain, by parsing a found configuration file and from theconfiguration file, at least information such as each menu item and themenu ID of the local menu to which each menu item belongs, and store theobtained information in a configuration manager.

The configuration manager is stored in an unoccupied space area in thememory of a mobile phone, and the configuration manager is configured tostore a correspondence between a menu item of a third-party applicationand a menu ID of a local menu to which the menu item belongs. Forexample, the configuration file shown in FIG. 1 is parsed to obtain,from the configuration file shown in Table 1, two menu items and IDs ofthe local menus to which each menu item belongs, and the obtained twomenu items and the IDs of the local menus to which each menu itembelongs are stored in a configuration manager shown in Table 2.

TABLE 2 Configuration Manager Menu Item Local Menu Item Name Function IDApplication ID Icon ID Menu ID Mail ID101 ID10 ID102 ID1 DirectMessageID103 ID10 N/A ID18 . . . . . . . . . . . . . . .

When producing a mobile phone, a mobile phone manufacturer normally setsmultiple local applications in the mobile phone, where each localapplication includes multiple functions, and sets a corresponding localprimary menu for each local application, where the local primary menuincludes one or multiple menu items, and identity information of eachmenu item includes at least a function ID or a menu ID of a localsecondary menu. The structure of a local secondary menu is the same asthe structure of a local primary menu, and each local secondary menu mayalso include multiple menu items. In addition, the mobile phonemanufacturer further sets a unique ID for identifying each localsecondary menu and local primary menu. For the convenience ofdescription, the local primary menu and the local secondary menu may becollectively referred to as a local menu.

The database in an Android platform of the mobile phone stores acorrespondence between a menu ID of each local menu and each menu itemincluded in the local menu. For example, a mobile phone includes localapplications such as “Message”, “Address Book”, and “Setting”, and eachlocal application corresponds to a local primary menu. Table 3 shows acorrespondence between a menu ID of a local primary menu correspondingto the local application “Message” and each menu item in the localprimary menu. Each line of records in Table 3 includes a menu ID and amenu item. In Table 3, the menu item in each line of records includes amenu item name, identity information, and an icon ID, where the identityinformation may include two fields, namely, a function ID and asecondary menu ID. The identity information in each line of the recordsfrom line 2 to line 4 includes a function ID only, and the secondarymenu ID is left blank. The identity information in the record in line 5includes a secondary menu ID only, and the function ID is left blank.

TABLE 3 Menu Menu Item ID Menu Item Name Function ID Secondary Menu IDIcon ID ID1 Write Message ID10 N/A ID11 ID1 Inbox ID12 N/A ID13 ID1Outbox ID14 N/A ID15 ID1 Empty N/A ID18 ID17

In Table 3, the menu item of the record in line 5 includes a secondarymenu ID “ID18”, indicating that the menu item corresponds to a localsecondary menu whose ID is “ID18”. The structure of the local secondarymenu is the same as that of the local primary menu, which also includesmultiple menu items. As shown in Table 4, the mobile phone manufactureralso sets, for the local secondary menu, a correspondence between a menuID and each menu item included in the local secondary menu.

TABLE 4 Menu Menu Item ID Menu Item Name Function ID Icon ID SecondaryMenu ID ID18 Inbox ID19 N/A N/A ID18 Outbox ID20 N/A N/A ID18 Draft ID21N/A N/A

The mobile phone manufacturer stores Table 3 and Table 4 in the databaseof the Android platform. When producing the mobile phone, the mobilephone manufacturer burns the correspondences between the menu items andthe menu IDs stored in the database of the Android platform, togetherwith each local application, into the memory of the mobile phone.Therefore, in the memory of the mobile phone, the database of theAndroid platform and the configuration manager are located in differentstorage space respectively.

On a desktop of the mobile phone, the mobile phone manufacturer createsan icon for each local application, and binds an icon corresponding toeach local application with a menu ID of the local primary menucorresponding to the local application. A user submits a request foropening a menu by selecting an icon, where the request carries the menuID which is bound with the icon. Then, the following steps 203 to 206are performed to create the local primary menu corresponding to the menuID carried in the request.

Step 203: Receive the request for opening the menu, where the requestcarries the menu ID, and create the local primary menu corresponding tothe carried menu ID.

Specifically, the request for opening the menu is received; a menu listis created; all corresponding menu items are obtained, according to themenu ID carried in the request for opening the menu, in thecorrespondence between the menu item and the menu ID stored in thedatabase of the Android platform; the menu item name included in eachmenu item is filled in the created menu list; and in the menu list, themenu item name and the identity information in each menu item are bound,and thereby the local primary menu is obtained.

Further, if a menu item further includes an icon ID, a correspondingicon is obtained in the memory of the mobile phone according to the iconID, and correspondingly, the obtained icon, together with the menu itemname in the menu item, is filled in the created menu list.

For example, a request for opening a menu is received, where a menu IDcarried in the request is ID1; a menu list is created; and in the Table3 stored in a database of an Android platform, all corresponding menuitems are obtained according to the ID1 carried in the request. As shownin Table 5, each menu item includes an icon ID.

TABLE 5 Menu Item Menu Item Name Icon ID Function ID Secondary Menu IDWrite Message ID11 ID10 N/A Inbox ID13 ID12 N/A Outbox ID15 ID14 N/AEmpty ID17 N/A ID18

In a memory of the mobile phone, a corresponding icon is obtainedaccording to an icon ID in each menu item; the menu item name andcorresponding icon in each menu item are filled in the menu list; and inthe menu list, the menu item name and identity information included ineach menu item are bound, and thereby a local primary menu shown in FIG.3 is obtained. For example, the menu item shown in line 3 in Table 5includes the menu item name “Write Message”, a function “ID10” includedin the identity information, and an icon ID “ID11”. The correspondingicon is obtained according to the icon ID11; the menu item name “WriteMessage” in the menu item and the obtained icon are filled in the menulist; and the “Write Message” in the menu item is bound with thefunction “ID10”.

The created menu list has only one blank table, and each time a menuitem name is filled in the blank table, another blank table isautomatically created for the menu list. Therefore, the menu list alwayshas one blank table. Alternatively, two or more blank tables may beretained.

Step 204: Search the configuration manager for a corresponding menu itemaccording to the carried menu ID, where a found menu item includes atleast a menu item name and identity information.

All menu items found in the configuration manager are menu items of athird-party application. For example, the configuration manager shown inTable 2 is searched for a corresponding menu item according to a carriedID1, where the found menu item includes a menu item name “Mail” andidentity information which includes an application ID “ID10” and afunction ID “ID101”. The menu item is a menu item of the third-partyapplication “Mail System”.

Step 205: Add an obtained menu item to the local primary menu, anddisplay the local primary menu.

Specifically, in the menu list of the local primary menu, the menu nameincluded in the obtained menu item is filled in an unoccupied tablerespectively; the menu item name and identity information in theobtained menu item are bound in the local primary menu; and then thelocal primary menu is displayed. The unoccupied table refers to thepreceding blank table.

Further, if the obtained menu item further includes an icon ID, acorresponding icon is obtained from a file set of a third-partyapplication installed on the mobile phone, and correspondingly, the iconand the menu item name of the menu item are filled in the unoccupiedtable in the menu list of the local primary menu.

For example, according to an icon ID “ID102”, the file set of thethird-party application installed in the mobile phone is searched forthe corresponding icon; and the menu item name “Mail” in the menu itemand the found icon are filled in the menu item list; the identityinformation in the menu item and the menu item name “Mail” are bound inthe menu list, that is, the application “ID10” and the function “ID101”are both bound to the menu item name “Mail”, and thereby the localprimary menu shown in FIG. 4 is obtained.

In this embodiment, unoccupied space is retained in the memory of themobile phone, where the space is used to store a menu item of athird-party application and an ID of the local menu to which the menuitem belongs. Therefore, it is not necessary to modify an Android codeto store the menu item of the third-party application and the ID of thelocal menu to which the menu item belongs in the database of Android.When a user needs to open a local primary menu, a local primary menuneeds to be opened by the user is created first, and then a menu item ofa third-party application is directly added to the local primary menu,and thereby the menu item of the third-party application is added to thelocal primary menu.

Further, when the user selects a menu item in the displayed localprimary menu, the background color of the menu item selected by the useris changed to a specific background color.

For example, the local primary menu shown in FIG. 4 may be displayed forthe user. When the user selects a menu item in the local primary menu,the local primary menu obtains identity information of the menu itemname which is bound in the menu item. If the obtained identityinformation includes a function ID only, the memory of the mobile phoneis searched for a corresponding function according to the obtainedfunction ID, that is, an API function for implementing the function issearched for, and then the found function is directly invoked. If theobtained identity information includes an application ID and a functionID, the memory of the mobile phone is searched for a file setcorresponding to the application according to the application ID, andthe found file set is searched for a corresponding function according tothe function ID, and then the found function in invoked. If the obtainedidentity information includes a secondary menu ID, a request for openinga menu is generated, where the request carries an obtained secondarymenu ID; the request for opening the menu is submitted; and thenaccording to the following steps 206 to 208, a secondary menu is createdand displayed.

Step 206: Receive a request for opening a menu, where the requestcarries a menu ID of a secondary menu, and create a local secondary menucorresponding to the carried secondary menu ID.

Specifically, the request for opening the menu is received; a menu listis created; all corresponding menu items are obtained, according to themenu ID carried in the request for opening the menu, in thecorrespondence between the menu item and the menu ID in the Androiddatabase of the mobile phone; the menu item name included in each menuitem is filled in the created menu list; and in the menu list, the menuitem name and the identity information in each menu item are bound, andthereby the local secondary menu is obtained.

Further, if a menu item further includes an icon ID, a correspondingicon is obtained in the memory of the mobile phone according to the iconID; and the obtained icon, together with the menu item name in the menuitem, is filled in the created menu list.

For example, in the menu list shown in FIG. 4, after a user selects“Empty”, a request for opening a menu is received, where the request foropening the menu carries a menu ID ID18; a menu list is created; and theTable 4 stored in the database of Android is searched for allcorresponding menu items according to the carried ID18, as shown inTable 6.

TABLE 6 Menu Item Menu Item Name Function ID Inbox ID19 Outbox ID20Draft ID21

The menu item names “Inbox,” “Outbox,” and “Draft” shown in FIG. 6 arefilled in the created menu list; in the menu list, “Inbox” and “ID19”are bound, “Outbox” and “ID20” are bound, and “Draft” and “ID21” arebound, and thereby the local secondary menu shown in FIG. 5 is obtained.Certainly, when the secondary menu is created, at least one blank tablemay always be retained in the created menu list as described in step203.

Step 207: The configuration manager is searched for a corresponding menuitem according to the carried menu ID of the secondary menu, where thefound menu item includes at least a menu item name and identityinformation.

For example, a configuration manager such as the one shown in Table 2 issearched for a corresponding menu item according to the carried ID18,where the menu item includes a menu item name “DirectMessage” andidentity information which includes a function ID “ID103” and anapplication ID “ID10.”

Step 208: Add the obtained menu item to the local secondary menu, anddisplay the local secondary menu.

Specifically, the menu name included in the obtained menu item is filledin an unoccupied table in the menu list of the local secondary menu; themenu item name and identity information in the obtained menu item arebound in the local secondary menu; and then the local secondary menu isdisplayed.

For example, the obtained menu item name “DirectMessage” is filled inthe unoccupied table of the menu list of the local secondary menu; themenu item name of the menu item and the function ID “ID103” are bound inthe local secondary menu, and thereby the local secondary menu shown inFIG. 6 is obtained; and then the local secondary menu shown in FIG. 6 isdisplayed.

In the embodiment, when a user needs to open a local secondary menu, alocal secondary menu needs to be opened by the user is created first,and then a menu item of a third-party application is directly added tothe local secondary menu, and thereby the menu item of the third-partyapplication is added to the local secondary menu.

The mobile phone manufacturer sets an XSD (XML Schemas Definition)specification in the mobile phone, where the structure of each localmenu in the mobile phone is defined in an XSD specification. Further,after step 201 is performed and before step 202 is performed, the foundconfiguration file may be verified according to the XSD specification inthe mobile phone; if the verification is passed, step 202 is performed;otherwise, the operation ends. For example, assume that a local menu isdefined in the XSD and no new menu item is allowed to be added, but afound configuration file has a menu item to be added to the local menu,when the found configuration file is being verified by using the XSDspecification, a result of verification failure is obtained, and theoperation ends.

In this embodiment, in the process of adding a menu item of athird-party application, the code in the Android platform of a mobilephone is not modified. Therefore, every local application in the mobilephone is not damaged. When the third-party application needs tocommunicate information to the local application, the third-partyapplication needs to first submit, to the Android platform, theinformation to be communicated, and the Android platform receives theinformation to be communicated and forwards, to the local application,the information to be communicated.

The method provided in this embodiment is capable of adding a menu itemof a third-party application to a local menu in any terminal devicesupporting an Android platform.

In the embodiment of the present invention, a menu item of a third-partyapplication and an ID of a local menu to which the menu item belongs arestored in a configuration manager. When a local menu is created, themenu item of the third-party application to be added to the local menuis obtained from the configuration manager, and the obtained menu itemis added to the local menu. The menu item of the third-party applicationand the ID of the local menu to which the menu item belongs are storedin the configuration manager; therefore, the menu item of thethird-party application may be added to the database of Android withoutmodifying an Android code. The menu item of the third-party applicationis directly added to the local menu, and thereby the menu item of thethird-party application is added to the local menu.

Embodiment 3

As shown in FIG. 7, an embodiment of the present invention provides adevice for adding a menu item to an Android menu, including:

a first creating module 301, configured to receive a request for openinga local menu, where the request carries a menu ID, and create a localmenu corresponding to the menu ID;

an obtaining module 302, configured to obtain according to the menu ID,in a stored correspondence between the menu item of a third-partyapplication and a local menu ID, a menu item of a correspondingthird-party application; and

an adding module 303, configured to add the obtained menu item of thethird-party application to the local menu, and display the local menu towhich the menu item of the third-party application is added;

where the obtained menu item of the third-party application includes atleast a menu item name and identity information; and correspondingly,

the adding module 303 specifically includes:

a filling unit, configured to: in a menu list of local menus, fill anunoccupied table in the menu list with the menu item name of theobtained menu item of the third-party application;

a binding unit, configured to bind the menu item name of the menu itemof the third-party application with the identity information, where theidentity information is used to identify a function or a secondary menu;and

a first displaying unit, configured to display the local menu to whichthe menu item of the third-party application is added.

If the obtained menu item of the third-party application furtherincludes an icon ID, the adding module 303 further includes:

a searching unit, configured to search a file set of the third-partyapplication for an icon corresponding to the icon ID.

Correspondingly,

the filling unit is specifically configured to fill an unoccupied tablein the menu list with the menu item name of the menu item of thethird-party application and a found icon.

Further, the device includes:

a storing module, configured to search a file set of the third-partyapplication for a configuration file; obtain, by parsing theconfiguration file, the menu item of the third-party application and thelocal menu ID to which the menu item belongs; and store the menu item ofthe third-party application and the local menu ID to which the menu itembelongs in unoccupied space.

Further, the device includes:

a verifying module, configured to: after the storing module finds theconfiguration file, verify the configuration file according to a definedstructure of local menus.

Further, the device includes:

a first obtaining module, configured to: when a user selects a menu itemin the local menu to which the menu item of the third-party applicationis added, obtain the identity information bound with the menu item namein the selected menu item;

a second obtaining module, configured to: if the obtained identityinformation includes a function ID, obtain a corresponding functionaccording to the function ID; and

a second creating module, configured to: if the obtained identityinformation includes a secondary menu ID, create a secondary menucorresponding to the secondary menu ID.

The second creating module specifically includes:

a creating unit, configured to create a local secondary menucorresponding to the secondary menu ID;

an obtaining unit, configured to obtain according to the secondary menuID, in the stored correspondence between the menu item of thethird-party application and the local menu ID, a menu item of acorresponding third-party application;

an adding unit, configured to add the menu item of the third-partyapplication to the local secondary menu; and

a second displaying unit, configured to display the local secondary menuto which the menu item of the third-party application is added.

The device may be a mobile phone where an Android platform is installedor a terminal device supporting the Android platform.

In the embodiment of the present invention, a menu item of a third-partyapplication and an ID of a local menu to which the menu item belongs arestored in a configuration manager. When a local menu is created, themenu item of the third-party application that needs to be added to thelocal menu is obtained from the configuration manager, and the obtainedmenu item is added to the local menu. The menu item of the third-partyapplication and the ID of the local menu to which the menu item belongsare stored in the configuration manager; therefore, the menu item of thethird-party application may be added to the database of Android withoutmodifying an Android code. The menu item of the third-party applicationis directly added to the local menu, and thereby the menu item of thethird-party application is added to the local menu.

Persons skilled in the art may understand that all or part of the stepsof the various methods according to the embodiments may be implementedby a program instructing relevant hardware. The program may be stored ina computer readable storage medium, and the storage medium may include aROM, a RAM, a magnetic disk, or a CD-ROM, and so on.

The above specific embodiments further describe the objective, technicalsolutions, and benefits of the present invention in detail. It should beunderstood that the above are merely exemplary embodiments of thepresent invention, and are not intended to limit the protection scope ofthe present invention. Any modifications, equivalent replacements, andimprovements made without departing from the spirit and principle of thepresent invention shall fall within the protection scope of the presentinvention.

1. A method for adding a menu item to an Android menu, comprising:receiving a request for opening a local menu, wherein the requestcarries a menu ID, and creating a local menu corresponding to the menuID; obtaining according to the menu ID, in a stored correspondencebetween a menu item of a third-party application and the menu ID, a menuitem of a corresponding third-party application; adding the menu item ofthe third-party application to the local menu; and displaying the localmenu to which the menu item of the third-party application is added. 2.The method according to claim 1, wherein the menu item of thethird-party application comprises at least a menu item name and identityinformation, and correspondingly, the adding the menu item of thethird-party application to the local menu specifically comprises: in amenu list of the local menu, filling an unoccupied table in the menulist with the menu item name; and binding the menu item name of the menuitem with the identity information, wherein the identity information isused to identify a function or a secondary menu.
 3. The method accordingto claim 2, wherein if the menu item of the third-party applicationfurther comprises an icon ID, before filling the unoccupied table in themenu list with the menu item name, the method further comprises:searching a file set of the third-party application for an iconcorresponding to the icon ID; correspondingly, the filling theunoccupied table in the menu list with the menu item name specificallycomprises: filling the unoccupied table in the menu list with the menuitem name and the icon.
 4. The method according to claim 1, wherein thecorrespondence between the menu item of the third-party application andthe menu ID is obtained in the following manner: searching a file set ofthe third-party application for a configuration file; obtaining, byparsing the configuration file, the menu item of the third-partyapplication and the menu ID to which the menu item belongs; and storingthe menu item of the third-party application and the menu ID to whichthe menu item belongs in unoccupied space.
 5. The method according toclaim 2, wherein after displaying the local menu to which the menu itemof the third-party application is added, the method further comprises:when a user selects a menu item in the local menu to which the menu itemof the third-party application is added, obtaining the identityinformation bound with the menu item name in the selected menu item; ifthe identity information comprises a function ID, starting acorresponding function according to the function ID; and if the identityinformation comprises a secondary menu ID, creating a secondary menucorresponding to the secondary menu ID.
 6. The method according to claim5, wherein the creating the secondary menu corresponding to thesecondary menu ID specifically comprises: creating a local secondarymenu corresponding to the secondary menu ID; obtaining according to thesecondary menu ID, in the stored correspondence between the menu item ofthe third-party application and the secondary menu ID, the menu item ofthe corresponding third-party application; adding the menu item of thethird-party application to the local secondary menu; and displaying thelocal secondary menu to which the menu item of the third-partyapplication is added.
 7. A device for adding a menu item to an Androidmenu, comprising: a first creating module, configured to receive arequest for opening a local menu, wherein the request carries a menu ID,and create a local menu corresponding to the menu ID; an obtainingmodule, configured to obtain according to the menu ID, in a storedcorrespondence between the menu item of a third-party application andthe menu ID, a menu item of a corresponding third-party application; andan adding module, configured to add the menu item of the third-partyapplication to the local menu, and display the local menu to which themenu item of the third-party application is added.
 8. The deviceaccording to claim 7, wherein the menu item of the third-partyapplication comprises at least a menu item name and identityinformation, and correspondingly, the adding module specificallycomprises: a filling unit, configured to, in a menu list of the localmenus, fill an unoccupied table in the menu list with the menu itemname; a binding unit, configured to bind the menu item name of the menuitem with the identity information, wherein the identity information isused to identify a function or a secondary menu; and a first displayingunit, configured to display the local menu to which the menu item of thethird-party application is added.
 9. The device according to claim 8,wherein the adding module further comprises: a searching unit,configured to search a file set of the third-party application for anicon corresponding to an icon ID; wherein correspondingly, the fillingunit is specifically configured to fill the unoccupied table in the menulist with the menu item name and the icon.
 10. The device according toclaim 7, further comprising: a storing module, configured to search afile set of the third-party application for a configuration file;obtain, by parsing the configuration file, the menu item of thethird-party application and the menu ID to which the menu item belongs;and store the menu item of the third-party application and the menu IDto which the menu item belongs in unoccupied space.
 11. The deviceaccording to claim 7, further comprising: a first obtaining module,configured to: when a user selects a menu item in the local menu towhich the menu item of the third-party application is added, obtain theidentity information bound with the menu item name in the selected menuitem; a second obtaining module, configured to: if the identityinformation comprises a function ID, start a corresponding functionaccording to the function ID; and a second creating module, configuredto: if the identity information comprises a secondary menu ID, create asecondary menu corresponding to the secondary menu ID.
 12. The deviceaccording to claim 11, wherein the second creating module specificallycomprises: a creating unit, configured to create a local secondary menucorresponding to the secondary menu ID; an obtaining unit, configured toobtain according to the secondary menu ID, in the stored correspondencebetween the menu item of the third-party application and the secondarymenu ID, a menu item of a corresponding third-party application; anadding unit, configured to add the menu item of the third-partyapplication to the local secondary menu; and a second displaying unit,configured to display the local secondary menu to which the menu item ofthe third-party application is added.